<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三角形</title>
    <style>
        .d{
            width: 200px;
            height: 200px;
            background-color: gray;
        }
        .s{
            width: 0px; height: 0px;
            border: solid 20px transparent;
            border-bottom: 20px gray solid;
        }
        .c{
            width: 0px;
            margin: 50px auto;
            border: solid 40px transparent;
            border-bottom: 40px gray solid;
            border-top: 40px green solid;
        }
    </style>
</head>
<body>
    <div class="s"></div>
    <div class="d"></div>
    <div class="c"></div>
</body>
</html>